﻿using System;

namespace WebApi.ViewModel
{
    public class QueryReportVM
    {
        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime Start { get; set; }
        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime End { get; set; }
        /// <summary>
        /// 字段名
        /// </summary>
        public ReportWhereModel Where1 { get; set; }
        /// <summary>
        /// 字段名
        /// </summary>
        public ReportWhereModel Where2 { get; set; }
        /// <summary>
        /// 字段名
        /// </summary>
        public ReportWhereModel Where3 { get; set; }
        /// <summary>
        /// 字段名
        /// </summary>
        public ReportWhereModel Where4 { get; set; }
        /// <summary>
        /// 字段名
        /// </summary>
        public ReportWhereModel Where5 { get; set; }
        /// <summary>
        /// 字段名
        /// </summary>
        public ReportWhereModel Where6 { get; set; }

        /// <summary>
        /// Where前面语句，包括SELECT 列名 FROM 表名 WHERE 1=1 
        /// </summary>
        public string PrevWhere { get; set; }
        /// <summary>
        /// Where后续语句，包括分组排序等
        /// </summary>
        public string NextWhere { get; set; }

        public class ReportWhereModel
        {
            /// <summary>
            /// 列信息
            /// </summary>
            public ReportFieldInfo FieldInfo { get; set; }
            /// <summary>
            /// 值
            /// </summary>
            public string Value { get; set; }
            /// <summary>
            /// 值
            /// </summary>
            public string Value2 { get; set; }
        }

        public class ReportFieldInfo
        {
            /// <summary>
            /// 列名
            /// </summary>
            public string Field { get; set; }
            /// <summary>
            /// 查询类型0:使用=，1:使用like
            /// </summary>
            public int SelectType { get; set; }
        }
    }
}
